package cn.lbwfree.day3_26;

import java.util.Scanner;

/**
 * @date:2020年3月26日
 * @author:lbwfree
 * number:BASIC-24 龟兔赛跑预测
 */
public class RunPrediction_0 {
	public static void main(String[] args) {
		Scanner inScanner = new Scanner(System.in);
		int v1, v2, t, s,l;
		v1 = inScanner.nextInt();
		v2 = inScanner.nextInt();
		t = inScanner.nextInt();
		s = inScanner.nextInt();
		l = inScanner.nextInt();
		int second=0;
		int Lrabbit = 0; //兔子走了的路程
		int Ltortoise = 0; // 乌龟的路程
		while(true){
			int flag=0;
			second++;
			Lrabbit += v1;
			Ltortoise += v2;
			if(Lrabbit>=l|| Ltortoise>=l)
			{
				break;
			}
			while(Lrabbit-Ltortoise >= t)
			{
				for (int i = 0; i < s; i++) {
					second++;
					Ltortoise += v2;
					if(Ltortoise>=l)
					{
						flag=1;
						break;
					}
						
				}
				if (flag ==1) {
					break;
				}		
			}
			if (flag ==1) {
				break;
			}	
		}
		if(Lrabbit>Ltortoise)
		{
			System.out.println("R");
			System.out.println(second);
		}else if(Lrabbit==Ltortoise) {
			System.out.println("D");
			System.out.println(second);
		}else if (Lrabbit<Ltortoise) {
			System.out.println("T");
			System.out.println(second);
		}
	}
}
